<?php
if(!defined('BZ_XTBLOG') || !defined('BZ_WJSCUZ')) {
	exit('Access Denied');
}
$uid=verify_id($_GET['uid']);
$act=$_GET['act'];
$wzxx_title ='好友管理-'.$wzxx_title.'';
$wzxx_gj    ='好友管理-'.$wzxx_gj.'';
$wzxx_ms    ='好友管理-'.$wzxx_ms.'';
	if(!$user_uid){
		 $pdid='1';
	}elseif($act == 'jia'){
    if(!$db->get_one('user',"`uid` = '$uid' ",'uid')){
        $pdid='2';
    }elseif($user_uid == $uid ){
        $pdid='4';
    }elseif($db->get_one('user_haoy',"`uid` = '$user_uid'  and `hyid` = '$uid' ",'uid') ){
        $pdid='3';
    }else{
        $db->insert('user_haoy',array('uid' => $user_uid, 'hyid' => $uid, 'time_a'=> $time));	
	      Bingz_message_post('0',$uid,'你好！会员([url=index.php?'.$Bingz_ml.'=user&'.$Bingz_md.'=index&uid='.$user_uid.']'.$user_name.'[/url])添加你为好友！');
        $pdid='5';
    }
	}elseif($act == 'sok'){
    if($db->get_one('user_haoy',"`uid` = '$user_uid'  and `hyid` = '$uid' ",'uid')){
       $db->delete('user_haoy',"`uid` = '$user_uid'  and `hyid` = '$uid' ");
    }
    $pdid='5';
	}else{
		  $sqma=$db->query('user_haoy',"`uid` = '$user_uid' ORDER BY `time_a` DESC",'');
      while($hya=mysql_fetch_array($sqma)){
             $name =$user_class->user_name($hya[hyid]);
             $tx =$user_class->user_tx($hya[hyid]);
             $sex=$user_class->user_sex($hya[hyid]);
             $sj=Bingz_time($hya['time_a']);
             $useru[]=array('sj' => $sj,'tx' => $tx,'sex'=> $sex,'uid'=> $hya[hyid],'name'=> $name);
      }
  }
@include template('head');
@include template('user/user_haoy');
@include template('foot');
?>